import request from '@/utils/request';
import Qs from "qs";
import { HmProductsVo, InventoryReviewQueryParmas } from './types'
/**
 * 查询商品列表
 * @param data
 * @returns
 */
export const hmProductsLotrecordList = (data: any) => {
    return request({
        url: '/basic/hmProducts/list',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
/**
 * 根据商品查询入库记录(30天)
 * @param data
 * @returns {*}
 */

export const getStorageRecordByTime = (data: any) => {
    return request({
        url: "/basic/stock/getStorageRecordByTime",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};
/**
 * 根据商品查询出库记录(30天)
 * @param data
 * @returns {*}
 */

export const selectOutStockAppListByTime = (data: any) => {
    return request({
        url: "/basic/stockOut/selectOutStockAppListByTime",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

// 产品部审核列表
export function getStockPcList(data: any) {
    return request({
        url: "/basic/stock/getStockPcList",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
}
// 产品部审核通过
export function pass(data: any) {
    return request({
        url: "/basic/stock/pass",
        method: "post",
        data
    });
}

// 产品部审核驳回
export function refuse(data: any) {
    return request({
        url: "/basic/stock/refuse",
        method: "post",
        data
    });
}

// 获取选品部门 => 主播
export function getCoreIdList() {
    return request({
        url: "/stock/passer/getCoreIdList",
        method: "post",
    });
}

// 产品部入库历史
export function getStorageRecord(data: any) {
    return request({
        url: "/basic/stock/getStorageRecord",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
}
// pc查询产品商品入库详单
export function getStorageDetailed(data: any) {
    return request({
        url: "/basic/stock/getStorageDetailed",
        method: "post",
        data
    });
}
// pc查询产品商品入库详单
export function selectOutDetailed(data: any) {
    return request({
        url: "/basic/stock/selectOutDetailed",
        method: "post",
        data
    });
}
// 盘点单明细列表
export function queryDetailList(data: any) {
    return request({
        url: "/basic/stockCount/queryDetailList",
        method: "post",
        data
    });
}

// 产品部入库记录详情
export function getStorageId(data: any) {
    return request({
        url: "/basic/stock/getStorageId",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
}
// 产品部入库记录详情修改留存照片
export function updateByStorageId(data: any) {
    return request({
        url: "/basic/stock/updateByStorageId",
        method: "post",
        data
    });
}

// 产品部出库记录详情修改留存照片
export function updateOutStockAppList(data: any) {
    return request({
        url: "/basic/stockProduct/updateOutStockAppList",
        method: "post",
        data
    });
}

// 获取入库部门
export function getStickDept() {
    return request({
        url: "/stock/passer/getStickDept",
        method: "post",
    });
}

// 获取入库部门
export function getUserLists(data: any) {
    return request({
        url: "/stock/passer/getUserList",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
}

/**
 * 查询出库商品列表
 */
export const queryProduct = (data: any) => {
    return request({
        url: '/basic/warehouse/queryProduct',
        method: 'post',
        data
    });
};

/**
 * 查询商品类目列表
 */
export const getCategoryList = (data: any) => {
    return request({
        url: '/basic/category/childrenList',
        method: 'post',
        data
    });
};

/**
 * 新增类目
 */
export const categoryAdd = (data: any) => {
    return request({
        url: '/basic/category/add',
        method: 'post',
        data
    });
};

/**
 * 修改类目
 */
export const categoryEdit = (data: any) => {
    return request({
        url: '/basic/category/edit',
        method: 'post',
        data
    });
};

/**
 * 启用类目
 */
export const enableCategoryId = (categoryId: any) => {
    return request({
        url: '/basic/category/enable/' + categoryId,
        method: 'post'
    });
};

/**
 * 禁用类目
 */
export const disableCategoryId = (categoryId: any) => {
    return request({
        url: '/basic/category/disable/' + categoryId,
        method: 'post',
    });
};

/**
 * 删除类目
 */
export const deleteCategoryId = (data: any) => {
    return request({
        url: '/basic/category/remove',
        method: 'post',
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

/**
 * 主播选品出库
 */
export const addStockOut = (data: any) => {
    return request({
        url: '/basic/stockProduct/addStockOut',
        method: 'post',
        data
    });
};

/**
 * 类目：获取所有类目
 * @param query
 * @returns {*}
 */

export const getCategoryLists = () => {
    return request({
        url: "/basic/category/list",
        method: "post"
    });
};


/**
 * 查询拉群邀请列表
 * @param query
 * @returns {*}
 */

export const getChatList = (data: any) => {
    return request({
        url: "/basic/chat/list",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

/**
 * 修改拉群邀请
 * @param query
 * @returns {*}
 */

export const upadteChat = (data: any) => {
    return request({
        url: "/basic/chat",
        method: "post",
        data
    });
};

/**
 * 出库记录
 * @param query
 * @returns {*}
 */

export const selectOutStockList = (data: any) => {
    return request({
        url: "/basic/stockProduct/selectOutStockList",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

/**
 * 补样管理
 * @param query
 * @returns {*}
 */

export const getSampleInvitationList = (data: any) => {
    return request({
        url: "/basic/sampleInvitation/getSampleInvitationList",
        method: "post",
        data,
    });
};

/**
 * 补样管理-拒绝响应
 * @param query
 * @returns {*}
 */

export const refuseResPond = (data: any) => {
    return request({
        url: "/basic/sampleInvitation/refuseResPond",
        method: "post",
        data,
    });
};

/**
 * 补样管理-批量入库
 * @param query
 * @returns {*}
 */

export const batchStorage = (data: any) => {
    return request({
        url: "/basic/sampleInvitation/batchStorage",
        method: "post",
        data,
    });
};

// 出库详单作废
export const cancelStockOut = (data: any) => {
    return request({
        url: '/basic/stockProduct/cancelStockOut',
        method: 'post',
        data
    });
};

/**
 * 出库记录详情
 * @param query
 * @returns {*}
 */

export const selectOutStockById = (data: any) => {
    return request({
        url: "/basic/stockProduct/selectOutStockById",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

/**
 * 上架下架记录
 * @param query
 * @returns {*}
 */

export const getOffRecordList = (data: any) => {
    return request({
        url: "/basic/stock/getOffRecordList",
        method: "post",
        data,
    });
};

/**
 * 获取产品部门信息
 * @param query
 * @returns {*}
 */

export const getStickProductDept = () => {
    return request({
        url: "/stock/passer/getStickDept",
        method: "post",
    });
};

/**
 * 获取产品部门信息
 * @param query
 * @returns {*}
 */

export const getUserProductList = (data: any) => {
    return request({
        url: "/stock/passer/getUserList",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};

/**
 * 下架记录详情
 */
export const getOffRecordId = (id: string) => {
    return request({
        url: "/basic/stock/" + id,
        method: "post",
    });
};

/**
 * 盘点记录列表
 * @param data
 * @returns {*}
 */

export const queryCountList = (data: any) => {
    return request({
        url: "/basic/stockCount/queryCountList",
        method: "post",
        data
    });
};

/**
 * 盘点记录详情
 * @param data
 * @returns {*}
 */

export const queryCountDetailList = (data: any) => {
    return request({
        url: "/basic/stockCount/queryCountDetailList",
        method: "post",
        data
    });
};


/**
 * 调拨记录
 * @param data
 * @returns {*}
 */

export const selectAllotList = (data: any) => {
    return request({
        url: "/basic/stock/selectAllotList",
        method: "post",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};


/**
 * 上架记录详情
 * @param query
 * @returns {*}
 */

// export const selectOutStockById = (data: any) => {
//     return request({
//         url: "/basic/stockProduct/selectOutStockById",
//         method: "post",
//         headers: { "Content-Type": "application/x-www-form-urlencoded" },
//         data: Qs.stringify(data),
//     });
// };

/**
 * 查询商品列表
 * @param data
 * @returns
 */
export const hmProductsPcList = (data: any) => {
    return request({
        url: '/basic/hmProducts/pcList',
        method: 'post',
        data
    });
};

/**
 * 研发查询商品列表
 * @param data
 * @returns
 */
export const getInventListPC = (data: any) => {
    return request({
        url: '/basic/hmProducts/getInventListPC',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
/**
 * 聚水潭查询商品列表
 * @param data
 * @returns
 */
export const getJvshuitanData = (data: any) => {
    return request({
        url: '/basic/jvshuitanData/list',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};

/**
 * 出入库部门维护查询列表
 * @param data
 * @returns {*}
 */

export const getOutDeptList = (data: any) => {
    return request({
        url: "/basic/outDept/getOutDeptList",
        method: "post",
        data
    });
};

/**
 * 出入库部门启用禁用
 * @param data
 * @returns {*}
 */

export const updateByIds = (data: any) => {
    return request({
        url: "/basic/outDept/updateByIds",
        method: "post",
        data
    });
};

/**
 * 出入库部门删除出库部门
 * @param data
 * @returns {*}
 */

export const deleteByIds = (data: any) => {
    return request({
        url: "/basic/outDept/deleteByIds",
        method: "post",
        data
    });
};

/**
 * 出入库部门新增出库部门
 * @param data
 * @returns {*}
 */

export const addOutDept = (data: any) => {
    return request({
        url: "/basic/outDept",
        method: "post",
        data
    });
};

/**
 * 查询部门下拉树结构
 */
export const deptTreeSelect = () => {
    return request({
        url: '/system/user/outDeptTree',
        method: 'get'
    });
};

// 新-产品待接收列表
export const getStockList = (data: any) => {
    return request({
        url: '/basic/changeAudit/getStockList',
        method: 'post',
        data
    });
};

// 产品部变价接收操作
export const stockAccept = (data: any) => {
    return request({
        url: '/basic/changeAudit/stockAccept',
        method: 'post',
        data
    });
};

// 获取oss类
export const getAliOssSts = (data: any) => {
    return request({
        url: '/system/client/getAliOssSts',
        method: 'get',
        params: data
    });
};







// 库管列表
export const commissionaireList = (data: any) => {
    return request({
        url: '/basic/commissionaire/getList',
        method: 'post',
        data
    });
};
// 库管列表  接收
export const commissionaireReceive = (data: any) => {
    return request({
        url: '/basic/commissionaire/receive',
        method: 'post',
        data
    });
};




// 审批中心核价初审列表
export const getPriceFirstListInventPe = (data: any) => {
    return request({
        url: '/basic/hmProducts/getPriceFirstListPc',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
// 审批中心核价复审列表
export const getPriceSecondListInventPe = (data: any) => {
    return request({
        url: '/basic/hmProducts/getPriceSecondListInventPc',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
// 审批中心无合同审批列表
export const getContractFirstListInventPe = (data: any) => {
    return request({
        url: '/basic/contractAudit/getContractFirstListInventPc',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
// 审批中心入库审批列表
export const getStockListInventPe = (data: any) => {
    return request({
        url: '/basic/stock/getStockListPc',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
        method: 'post',
        data: Qs.stringify(data),
    });
};
// 审批中心变价审批列表
export const getStockPriceInventPe = (data: any) => {
    return request({
        url: '/basic/changeAudit/getStockPricePc',
        method: 'post',
        data
    });
};

